function floatObject(id,xy){
	this.ID = id;
	this.htmlEle = document.getElementById(this.ID)?document.getElementById(this.ID):null;
	if(!this.htmlEle) return;
	this.ie = document.all&&navigator.userAgent.indexOf("Opera")==-1;
	this.w = this.htmlEle.offsetWidth;
	this.h = this.htmlEle.offsetHeight;
	if(xy) this.initPosition(xy);
	this.x = this.htmlEle.style.left;
	this.y = this.htmlEle.style.top;
	this.htmlEle.style.visibility = "visible";
}

floatObject.prototype.positionit = function (){
	var scrollL = this.ie?document.body.scrollLeft:pageXOffset;
	var scrollT = this.ie?document.body.scrollTop:pageYOffset;
	var windowW = this.ie?document.body.clientWidth:window.innerWidth-20;
	var windowH = this.ie?document.body.clientHeight:window.innerHeight;
	this.htmlEle.style.left = parseInt(scrollL)+parseInt(this.x);
	this.htmlEle.style.top = parseInt(scrollT)+parseInt(this.y);
}

floatObject.prototype.initPosition = function(xy){
	var x = xy.x,y = xy.y;
	var l = 0,t = 0;
	switch(x){
		case 'left'  : l = 0;break;
		case 'right' : l = this.ie?document.body.clientWidth-this.w:window.innerWidth-20-this.w-10;break;
		default      : l = x;
	}
	switch(y){
		case 'top'    : t = 0;break;
		case 'bottom' : t = this.ie?document.body.clientHeight-this.h:window.innerHeight-this.h-10;break;
		default       : t = y;
	}
	this.htmlEle.style.left = l;
	this.htmlEle.style.top = t;
}

function myAttachEvent(d,e,f){
	try {
		if(d.attachEvent) d.attachEvent("on"+e,f);
		else if(d.addEventListener) d.addEventListener(e,f,false);
		else{
			var oldF = eval('d.on'+e);
			if(typeof oldF!='function') eval('d.on'+e+'=f');
			else eval('d.on'+e)=function(){oldF();f();}
		}
	}
	catch (error){}
}
window.arrFloatObj = [];
window.floatTrigger = function (){for(var i=0;window.arrFloatObj[i];i++) if(window.arrFloatObj[i].htmlEle) window.arrFloatObj[i].positionit();}

//最大、最小化“网聘助手”操作柄
function float_min(clickImgObj,anotherImgObj,OperObjId){
	var Obj=document.getElementById(OperObjId);
	var Img=document.getElementById(anotherImgObj);
    if(Obj.style.display==''){
	  Obj.style.display='none';

	  clickImgObj.disabled=true;
	  clickImgObj.style.cursor='auto';
	  clickImgObj.src='images/float_min_disabled.gif';

	  Img.disabled=false;
	  Img.style.cursor='hand';
	  Img.src='images/float_max.gif';
	}
}

function float_max(clickImgObj,anotherImgObj,OperObjId){
	var Obj=document.getElementById(OperObjId);
	var Img=document.getElementById(anotherImgObj);
	if(Obj.style.display=='none'){
	  Obj.style.display='';

	  clickImgObj.disabled=true;
	  clickImgObj.style.cursor='auto';
	  clickImgObj.src='images/float_max_disabled.gif';

	  Img.disabled=false;
	  Img.style.cursor='hand';
	  Img.src='images/float_min.gif';
	}
  }

//移动“网聘助手”操作柄

function move(objId,e){
  if(e==null) e=window.event;

  var sClientHeight=document.body.clientHeight;
  var sScrollTop=(document.documentElement.scrollTop||document.body.scrollTop);
  var obj=document.getElementById(objId);

  if(down){
    obj.style.left=e.clientX-divleft;
	obj.style.top=e.clientY-divtop;
  }

  if(parseInt(obj.style.left)<0) obj.style.left=0; //左边界限制
  if(parseInt(obj.style.top)<sScrollTop) obj.style.top=sScrollTop+10; //上边界限制

  if(parseInt(obj.style.left)>(document.body.clientWidth-obj.clientWidth))//右边界限制
    obj.style.left=document.body.clientWidth-obj.clientWidth-20;
  
  //下边界限制 
 
  if(parseInt(obj.style.top)>(sClientHeight+sScrollTop-obj.clientHeight-10))
	obj.style.top=sClientHeight+sScrollTop-obj.clientHeight-10;

  document.getElementById('msg').innerHTML="x:"+obj.style.left+"<br>y:"+obj.style.top+"<br>scrollTop:"+sScrollTop+'<br>divLeft:'+divleft+'<br>divTop:'+divtop +'<br>divTop:'+obj.offsetTop;
}